package com.example.springboot.utils;

import java.util.ArrayList;

public class MyPageHelper {

    private Integer pageNum;
    private Integer pageSize;
    private Integer startPage;
    private Integer count;
    private Integer total;
    private ArrayList<?> dats;

    public MyPageHelper(Integer pageNum, Integer pageSize) {
        this.pageNum = pageNum;
        this.pageSize = pageSize;
//        this.startPage =
    }

    @Override
    public String toString() {
        return "MyPageHelper{" +
                "pageNum=" + pageNum +
                ", pageSize=" + pageSize +
                ", startPage=" + startPage +
                ", count=" + count +
                ", total=" + total +
                ", dats=" + dats +
                '}';
    }

    public Integer getPageNum() {
        return pageNum;
    }

    public void setPageNum(Integer pageNum) {
        this.pageNum = pageNum;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getStartPage() {
        return startPage;
    }

    public void setStartPage(Integer startPage) {
        this.startPage = startPage;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
        this.total = count%pageSize==0?count/pageSize:(count/pageSize)+1;
    }
    public Integer getTotal() {
        return total;
    }

    public void setTotal(Integer total) {
        this.total = total;
    }

    public ArrayList<?> getDats() {
        return dats;
    }

    public void setDats(ArrayList<?> dats) {
        this.dats = dats;
    }
}
